package com.sina.weibo;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;
import com.sina.weibo.models.CommentMessage;
import com.sina.weibo.models.MBlog;
import com.sina.weibo.models.User;
import com.sina.weibo.view.BaseLayout;
import com.sina.weibo.view.CommentMessageListItemView;
import com.sina.weibo.view.MBlogListItemView;
import com.sina.weibo.view.MainListItemView;
import com.sina.weibo.view.MessageListItemView;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MessageGroup extends ListBaseActivity
{
  public static final int DO_RESUME;
  WeiboListAdapter adapter = null;
  Handler handler;
  private int infoMode = 5;
  private Button mBnAt;
  private Button mBnComment;
  private Button mBnMessage;
  private ListView mLvMessage;
  private int mReadMode;

  public MessageGroup()
  {
    MessageGroup.1 local1 = new MessageGroup.1(this);
    this.handler = local1;
  }

  private boolean isNewCommer(int paramInt)
  {
    if ((paramInt != -1) && (this.mList != null) && (this.mList.size() != 0));
    int i;
    switch (this.infoMode)
    {
    default:
      i = 0;
    case 4:
    case 5:
    case 6:
    }
    while (true)
    {
      return i;
      long l1 = ((CommentMessage)this.mList.get(paramInt)).commenttime.getTime();
      long l2 = this.lastestItemTime;
      if (l1 <= l2)
        break;
      i = 1;
      continue;
      long l3 = ((MBlog)this.mList.get(paramInt)).time.getTime();
      long l4 = this.lastestItemTime;
      if (l3 <= l4)
        break;
      i = 1;
      continue;
      long l5 = ((com.sina.weibo.models.Message)this.mList.get(paramInt)).time.getTime();
      long l6 = this.lastestItemTime;
      if (l5 <= l6)
        break;
      i = 1;
    }
  }

  private void setTitleBtnSelected(int paramInt)
  {
    switch (MainTabActivity.mMode)
    {
    default:
    case 5:
    case 4:
    case 6:
    }
    while (true)
    {
      return;
      int i = StaticInfo.mTotals[5];
      this.mTotals = i;
      handleTitleBarEvent(2);
      continue;
      int j = StaticInfo.mTotals[4];
      this.mTotals = j;
      handleTitleBarEvent(3);
      continue;
      int k = StaticInfo.mTotals[6];
      this.mTotals = k;
      handleTitleBarEvent(4);
    }
  }

  protected void doItemMenu(String paramString)
  {
    int i = this.mExpectItem - 1;
    Resources localResources = getResources();
    switch (this.infoMode)
    {
    default:
    case 4:
    case 6:
    case 5:
    }
    while (true)
    {
      return;
      String str1 = localResources.getString(2131427518);
      if (paramString.equals(str1))
      {
        Intent localIntent1 = new Intent(this, UserInfoActivity2.class);
        CommentMessage localCommentMessage1 = (CommentMessage)this.mList.get(i);
        String str2 = localCommentMessage1.commentuid;
        Intent localIntent2 = localIntent1.putExtra("uid", str2);
        String str3 = StaticInfo.mUser.uid;
        Intent localIntent3 = localIntent1.putExtra("myuid", str3);
        String str4 = localCommentMessage1.commentnick;
        Intent localIntent4 = localIntent1.putExtra("nick", str4);
        Intent localIntent5 = localIntent1.putExtra("vip", 1);
        this.mParent.startActivity(localIntent1);
        continue;
      }
      String str5 = localResources.getString(2131427512);
      if (paramString.equals(str5))
      {
        CommentMessage localCommentMessage2 = (CommentMessage)this.mList.get(i);
        MainTabActivity localMainTabActivity1 = this.mParent;
        Intent localIntent6 = Utils.commentComment(this, localCommentMessage2);
        localMainTabActivity1.startActivity(localIntent6);
        continue;
      }
      String str6 = localResources.getString(2131427521);
      if (paramString.equals(str6))
      {
        CommentMessage localCommentMessage3 = (CommentMessage)this.mList.get(i);
        FetchSingleblogTask localFetchSingleblogTask = new FetchSingleblogTask(null);
        String[] arrayOfString = new String[1];
        String str7 = localCommentMessage3.mblogid;
        arrayOfString[0] = str7;
        AsyncTask localAsyncTask = localFetchSingleblogTask.execute(arrayOfString);
        continue;
      }
      if (!Utils.getWebPattern().matcher(paramString).matches())
        continue;
      Intent localIntent7 = new Intent("android.intent.action.VIEW");
      Uri localUri1 = Uri.parse(paramString);
      Intent localIntent8 = localIntent7.setData(localUri1);
      startActivity(localIntent7);
      continue;
      String str8 = localResources.getString(2131427519);
      if (paramString.equals(str8))
      {
        Intent localIntent9 = new Intent(this, UserInfoActivity2.class);
        com.sina.weibo.models.Message localMessage1 = (com.sina.weibo.models.Message)this.mList.get(i);
        String str9 = localMessage1.uid;
        Intent localIntent10 = localIntent9.putExtra("uid", str9);
        String str10 = StaticInfo.mUser.uid;
        Intent localIntent11 = localIntent9.putExtra("myuid", str10);
        String str11 = localMessage1.nick;
        Intent localIntent12 = localIntent9.putExtra("nick", str11);
        Intent localIntent13 = localIntent9.putExtra("vip", 1);
        this.mParent.startActivity(localIntent9);
        continue;
      }
      String str12 = localResources.getString(2131427513);
      if (paramString.equals(str12))
      {
        com.sina.weibo.models.Message localMessage2 = (com.sina.weibo.models.Message)this.mList.get(i);
        MainTabActivity localMainTabActivity2 = this.mParent;
        String str13 = localMessage2.nick;
        Intent localIntent14 = Utils.editPrivateMessage(this, str13);
        localMainTabActivity2.startActivity(localIntent14);
        continue;
      }
      String str14 = localResources.getString(2131427653);
      if (paramString.equals(str14))
      {
        com.sina.weibo.models.Message localMessage3 = (com.sina.weibo.models.Message)this.mList.get(i);
        Intent localIntent15 = new Intent(this, MessageList.class);
        Bundle localBundle = new Bundle();
        String str15 = localMessage3.uid;
        localBundle.putString("uid", str15);
        String str16 = localMessage3.nick;
        localBundle.putString("nick", str16);
        Intent localIntent16 = localIntent15.putExtras(localBundle);
        this.mParent.startActivity(localIntent15);
        continue;
      }
      if (!Utils.getWebPattern().matcher(paramString).matches())
        continue;
      Intent localIntent17 = new Intent("android.intent.action.VIEW");
      Uri localUri2 = Uri.parse(paramString);
      Intent localIntent18 = localIntent17.setData(localUri2);
      startActivity(localIntent17);
      continue;
      String str17 = localResources.getString(2131427510);
      if (paramString.equals(str17))
      {
        MBlog localMBlog1 = (MBlog)this.mList.get(i);
        MainTabActivity localMainTabActivity3 = this.mParent;
        Intent localIntent19 = Utils.forwardMBlog(this, localMBlog1);
        localMainTabActivity3.startActivity(localIntent19);
        continue;
      }
      String str18 = localResources.getString(2131427516);
      if (paramString.equals(str18))
      {
        MBlog localMBlog2 = (MBlog)this.mList.get(i);
        try
        {
          RPCHelper localRPCHelper = RPCHelper.getInstance(getApplication());
          User localUser1 = StaticInfo.mUser;
          String str19 = localMBlog2.mblogid;
          if (!((Boolean)localRPCHelper.addFavMBlog(localUser1, str19)[0]).booleanValue())
            break label860;
          String str20 = this.mCacheDir;
          User localUser2 = StaticInfo.mUser;
          Utils.cleanFavoriteListFile(str20, localUser2);
          String str21 = getString(2131427482);
          Toast.makeText(this, str21, 0).show();
        }
        catch (RPCHelper.HttpException localHttpException)
        {
        }
        continue;
        label860: String str22 = getString(2131427483);
        Toast.makeText(this, str22, 0).show();
        continue;
      }
      String str23 = localResources.getString(2131427511);
      if (paramString.equals(str23))
      {
        MBlog localMBlog3 = (MBlog)this.mList.get(i);
        MainTabActivity localMainTabActivity4 = this.mParent;
        String str24 = localMBlog3.mblogid;
        String str25 = localMBlog3.uid;
        Intent localIntent20 = Utils.simpleComment(this, str24, str25);
        localMainTabActivity4.startActivity(localIntent20);
        continue;
      }
      String str26 = localResources.getString(2131427518);
      if (!paramString.equals(str26))
        continue;
      Intent localIntent21 = new Intent(this, UserInfoActivity2.class);
      MBlog localMBlog4 = (MBlog)this.mList.get(i);
      String str27 = localMBlog4.uid;
      Intent localIntent22 = localIntent21.putExtra("uid", str27);
      String str28 = localMBlog4.nick;
      Intent localIntent23 = localIntent21.putExtra("nick", str28);
      String str29 = localMBlog4.uid;
      Intent localIntent24 = localIntent21.putExtra("myuid", str29);
      boolean bool = localMBlog4.vip;
      Intent localIntent25 = localIntent21.putExtra("vip", bool);
      this.mParent.startActivity(localIntent21);
    }
  }

  protected BaseAdapter getAdapter()
  {
    if (this.adapter == null)
    {
      WeiboListAdapter localWeiboListAdapter1 = new WeiboListAdapter();
      this.adapter = localWeiboListAdapter1;
    }
    if (this.adapter != null);
    for (WeiboListAdapter localWeiboListAdapter2 = this.adapter; ; localWeiboListAdapter2 = null)
      return localWeiboListAdapter2;
  }

  protected List<CharSequence> getMenuContent()
  {
    Resources localResources = getResources();
    ArrayList localArrayList1 = new ArrayList();
    Object localObject1 = null;
    try
    {
      List localList = this.mList;
      int i = this.mExpectItem - 1;
      Object localObject2 = localList.get(i);
      localObject1 = localObject2;
      label43: switch (this.infoMode)
      {
      default:
      case 4:
      case 6:
      case 5:
      }
      while (true)
      {
        return localArrayList1;
        ArrayList localArrayList2 = null;
        Matcher localMatcher;
        if ((localObject1 instanceof CommentMessage))
        {
          CommentMessage localCommentMessage = (CommentMessage)localObject1;
          localArrayList2 = new ArrayList();
          Pattern localPattern1 = Utils.getWebPattern();
          String str1 = localCommentMessage.commentcontent;
          localMatcher = localPattern1.matcher(str1);
          label120: if (localMatcher.find());
        }
        while (true)
        {
          String str2 = localResources.getString(2131427512);
          boolean bool1 = localArrayList1.add(str2);
          String str3 = localResources.getString(2131427518);
          boolean bool2 = localArrayList1.add(str3);
          String str4 = localResources.getString(2131427521);
          boolean bool3 = localArrayList1.add(str4);
          if ((localArrayList2 == null) || (localArrayList2.size() <= 0))
            break;
          boolean bool4 = localArrayList1.addAll(localArrayList2);
          break;
          String str5 = localMatcher.group();
          boolean bool5 = localArrayList2.add(str5);
          break label120;
          Utils.logd("msg: " + localObject1);
        }
        localArrayList2 = null;
        if ((localObject1 instanceof com.sina.weibo.models.Message))
        {
          com.sina.weibo.models.Message localMessage = (com.sina.weibo.models.Message)localObject1;
          localArrayList2 = new ArrayList();
          Pattern localPattern2 = Utils.getWebPattern();
          String str6 = localMessage.content;
          localMatcher = localPattern2.matcher(str6);
          label296: if (localMatcher.find());
        }
        while (true)
        {
          String str7 = localResources.getString(2131427513);
          boolean bool6 = localArrayList1.add(str7);
          String str8 = localResources.getString(2131427519);
          boolean bool7 = localArrayList1.add(str8);
          String str9 = localResources.getString(2131427653);
          boolean bool8 = localArrayList1.add(str9);
          if ((localArrayList2 == null) || (localArrayList2.size() <= 0))
            break;
          boolean bool9 = localArrayList1.addAll(localArrayList2);
          break;
          String str10 = localMatcher.group();
          boolean bool10 = localArrayList2.add(str10);
          break label296;
          Utils.logd("msg: " + localObject1);
        }
        String str11 = localResources.getString(2131427510);
        boolean bool11 = localArrayList1.add(str11);
        String str12 = localResources.getString(2131427511);
        boolean bool12 = localArrayList1.add(str12);
        String str13 = localResources.getString(2131427516);
        boolean bool13 = localArrayList1.add(str13);
        String str14 = localResources.getString(2131427518);
        boolean bool14 = localArrayList1.add(str14);
      }
    }
    catch (Exception localException)
    {
      break label43;
    }
  }

  protected Object[] getMessages(int paramInt1, int paramInt2)
  {
    int i = this.infoMode;
    Object[] arrayOfObject1 = getMessages(i, paramInt1, paramInt2);
    if (arrayOfObject1 != null);
    for (Object[] arrayOfObject2 = arrayOfObject1; ; arrayOfObject2 = null)
      return arrayOfObject2;
  }

  public Object[] getMessages(int paramInt1, int paramInt2, int paramInt3)
  {
    Object[] arrayOfObject = (Object[])0;
    switch (paramInt1)
    {
    default:
      if (arrayOfObject != null)
        break;
    case 4:
    case 6:
    case 5:
    }
    while (true)
    {
      int[] arrayOfInt2;
      int m;
      try
      {
        i = this.mTotals;
        this.mTotals = i;
        int[] arrayOfInt1 = StaticInfo.mTotals;
        int j = MainTabActivity.mMode;
        int k = this.mTotals;
        arrayOfInt1[j] = k;
        return arrayOfObject;
        RPCHelper localRPCHelper1 = RPCHelper.getInstance(getApplication());
        User localUser1 = StaticInfo.mUser;
        arrayOfObject = localRPCHelper1.getMyCommentList(localUser1, 1, paramInt2, paramInt3);
        arrayOfInt2 = StaticInfo.mTotals;
        m = 4;
        if (arrayOfObject[0] == 0)
          continue;
        i = ((Integer)arrayOfObject[0]).intValue();
        arrayOfInt2[m] = i;
      }
      catch (RPCHelper.HttpException localHttpException)
      {
        continue;
        i = 0;
        continue;
        RPCHelper localRPCHelper2 = RPCHelper.getInstance(getApplication());
        User localUser2 = StaticInfo.mUser;
        arrayOfObject = localRPCHelper2.getMessageList(localUser2, null, paramInt2, paramInt3);
        arrayOfInt2 = StaticInfo.mTotals;
        m = 6;
        if (arrayOfObject[0] == 0)
          continue;
        i = ((Integer)arrayOfObject[0]).intValue();
        arrayOfInt2[m] = i;
        break;
        i = 0;
        continue;
        RPCHelper localRPCHelper3 = RPCHelper.getInstance(getApplication());
        User localUser3 = StaticInfo.mUser;
        String str = StaticInfo.mUser.uid;
        int n = MainTabActivity.mPrefPictureSize;
        int i1 = paramInt2;
        int i2 = paramInt3;
        arrayOfObject = localRPCHelper3.getAtMsgList(localUser3, str, n, i1, i2);
        arrayOfInt2 = StaticInfo.mTotals;
        m = 5;
        if (arrayOfObject[0] == 0);
      }
      for (int i = ((Integer)arrayOfObject[0]).intValue(); ; i = 0)
      {
        arrayOfInt2[m] = i;
        break;
      }
      i = ((Integer)arrayOfObject[0]).intValue();
    }
  }

  protected void handleListItemClickEvent(int paramInt)
  {
    int i = this.mExpectItem - 1;
    switch (paramInt)
    {
    case 2:
    case 3:
    case 4:
    default:
    case 0:
    case 5:
    case 1:
    }
    while (true)
    {
      return;
      List localList1 = getMenuContent();
      showItemMenu(localList1);
      continue;
      switch (this.infoMode)
      {
      default:
        break;
      case 4:
        List localList2 = getMenuContent();
        showItemMenu(localList2);
        break;
      case 6:
        List localList3 = getMenuContent();
        showItemMenu(localList3);
        break;
      case 5:
        MBlog localMBlog = (MBlog)this.mList.get(i);
        Intent localIntent1 = new Intent();
        Context localContext = getApplicationContext();
        Intent localIntent2 = localIntent1.setClass(localContext, DetailWeiboActivity.class).putExtra("KEY_MBLOG", localMBlog);
        User localUser = StaticInfo.mUser;
        Intent localIntent3 = localIntent2.putExtra("KEY_MUSR", localUser);
        startActivity(localIntent3);
      }
    }
  }

  protected void handleTaskResult(List<?> paramList, String paramString)
  {
    if ((paramList != null) && (paramList.size() > 0))
      if (this.mList == null)
      {
        List<?> localList = paramList;
        this.mList = localList;
        int i = this.infoMode;
        List localList1 = this.mList;
        MessageGroup localMessageGroup1 = this;
        int j = i;
        List localList2 = localList1;
        localMessageGroup1.saveListCache(j, localList2);
      }
    while (true)
    {
      return;
      if (paramList.size() > 0)
      {
        switch (this.infoMode)
        {
        default:
        case 4:
        case 6:
        case 5:
        }
        while (true)
        {
          int k = this.infoMode;
          List localList3 = this.mList;
          MessageGroup localMessageGroup2 = this;
          int m = k;
          List localList4 = localList3;
          localMessageGroup2.saveListCache(m, localList4);
          break;
          int n = 0;
          Iterator localIterator1 = paramList.iterator();
          Object localObject1;
          Iterator localIterator2;
          while (localIterator1.hasNext())
          {
            localObject1 = (CommentMessage)localIterator1.next();
            localIterator2 = this.mList.iterator();
            String str1;
            String str2;
            do
            {
              if (!localIterator2.hasNext())
              {
                if (!this.mBeReload)
                  break label257;
                this.mList.add(n, localObject1);
                n += 1;
                break;
              }
              CommentMessage localCommentMessage = (CommentMessage)localIterator2.next();
              str1 = ((CommentMessage)localObject1).commentid;
              str2 = localCommentMessage.commentid;
            }
            while (!str1.equals(str2));
            continue;
            label257: boolean bool1 = this.mList.add(localObject1);
          }
          localIterator1 = paramList.iterator();
          com.sina.weibo.models.Message[] arrayOfMessage2;
          if (!localIterator1.hasNext())
          {
            List localList5 = this.mList;
            com.sina.weibo.models.Message[] arrayOfMessage1 = new com.sina.weibo.models.Message[0];
            arrayOfMessage2 = (com.sina.weibo.models.Message[])localList5.toArray(arrayOfMessage1);
            MessageGroup.4 local41 = new com/sina/weibo/MessageGroup$4;
            MessageGroup.4 local42 = local41;
            MessageGroup localMessageGroup3 = this;
            local42.<init>(localMessageGroup3);
            Arrays.sort(arrayOfMessage2, local41);
            ArrayList localArrayList = new ArrayList();
            this.mList = localArrayList;
            n = 0;
          }
          while (true)
          {
            int i1 = arrayOfMessage2.length;
            if (n >= i1)
            {
              localIterator1 = this.mList.iterator();
              while (localIterator1.hasNext())
              {
                com.sina.weibo.models.Message localMessage1 = (com.sina.weibo.models.Message)localIterator1.next();
                String str3 = String.valueOf(this.mCacheDir);
                StringBuilder localStringBuilder1 = new StringBuilder(str3).append(47);
                String str4 = StaticInfo.mUser.uid;
                StringBuilder localStringBuilder2 = localStringBuilder1.append(str4).append(95);
                String str5 = localMessage1.uid;
                String str6 = str5;
                boolean bool2 = new File(str6).delete();
              }
              localObject1 = (com.sina.weibo.models.Message)localIterator1.next();
              int i2 = 0;
              localIterator2 = this.mList.iterator();
              while (true)
              {
                if (!localIterator2.hasNext())
                {
                  boolean bool3 = this.mList.add(localObject1);
                  break;
                }
                com.sina.weibo.models.Message localMessage2 = (com.sina.weibo.models.Message)localIterator2.next();
                long l = localMessage2.time.getTime();
                String str7 = ((com.sina.weibo.models.Message)localObject1).uid;
                String str8 = localMessage2.uid;
                if (str7.equals(str8))
                {
                  if (((com.sina.weibo.models.Message)localObject1).time.getTime() <= l)
                    break;
                  Object localObject2 = this.mList.set(i2, localObject1);
                  break;
                }
                i2 += 1;
              }
            }
            List localList6 = this.mList;
            com.sina.weibo.models.Message localMessage3 = arrayOfMessage2[n];
            boolean bool4 = localList6.add(localMessage3);
            n += 1;
          }
          int i3 = 0;
          localIterator1 = paramList.iterator();
          while (localIterator1.hasNext())
          {
            localObject1 = (MBlog)localIterator1.next();
            localIterator2 = this.mList.iterator();
            String str9;
            String str10;
            do
            {
              if (!localIterator2.hasNext())
              {
                if (!this.mBeReload)
                  break label785;
                this.mList.add(i3, localObject1);
                i3 += 1;
                break;
              }
              MBlog localMBlog = (MBlog)localIterator2.next();
              str9 = ((MBlog)localObject1).mblogid;
              str10 = localMBlog.mblogid;
            }
            while (!str9.equals(str10));
            continue;
            label785: boolean bool5 = this.mList.add(localObject1);
          }
        }
      }
      int i4 = this.mPage - 1;
      this.mPage = i4;
      continue;
      if (StaticInfo.mUser != null)
      {
        if (paramList == null)
        {
          if (paramString == null)
            break label895;
          MessageGroup localMessageGroup4 = this;
          String str11 = paramString;
          int i5 = 0;
          Toast.makeText(localMessageGroup4, str11, i5).show();
        }
        while (true)
        {
          if ((this.mList != null) && (this.mList.size() != 0))
            break label935;
          int i6 = this.infoMode;
          MessageGroup localMessageGroup5 = this;
          int i7 = i6;
          localMessageGroup5.loadCache(i7);
          break;
          label895: MessageGroup localMessageGroup6 = this;
          int i8 = 2131427376;
          String str12 = localMessageGroup6.getString(i8);
          MessageGroup localMessageGroup7 = this;
          String str13 = str12;
          int i9 = 0;
          Toast.makeText(localMessageGroup7, str13, i9).show();
        }
        label935: continue;
      }
      MessageGroup localMessageGroup8 = this;
      int i10 = 2131427402;
      String str14 = localMessageGroup8.getString(i10);
      MessageGroup localMessageGroup9 = this;
      String str15 = str14;
      int i11 = 0;
      Toast.makeText(localMessageGroup9, str15, i11).show();
    }
  }

  protected void handleTitleBarEvent(int paramInt)
  {
    if ((this.mTask != null) && (!this.mTaskFree))
      boolean bool1 = this.mTask.cancel(1);
    switch (this.infoMode)
    {
    default:
      switch (paramInt)
      {
      default:
        label84: int i = this.infoMode;
        int j = MainTabActivity.mMode;
        if (i != j)
        {
          int k = MainTabActivity.mMode;
          this.infoMode = k;
          this.mLvMessage.setVisibility(4);
          int m = this.infoMode;
          loadCache(m);
          if ((this.mList != null) && (this.mList.size() != 0))
            break label484;
          this.mPage = 1;
          if ((this.mTask != null) && (!this.mTask.isCancelled()))
            boolean bool2 = this.mTask.cancel(1);
          ListBaseActivity.FetchDataTask localFetchDataTask1 = new ListBaseActivity.FetchDataTask(this);
          this.mTask = localFetchDataTask1;
          ListBaseActivity.FetchDataTask localFetchDataTask2 = this.mTask;
          String[] arrayOfString = new String[1];
          String str = String.valueOf(this.mPage);
          arrayOfString[0] = str;
          AsyncTask localAsyncTask = localFetchDataTask2.execute(arrayOfString);
          this.mBeReload = 1;
          this.mExpectItem = 1;
        }
      case 2:
      case 3:
      case 4:
      }
    case 4:
    case 6:
    case 5:
    }
    while (true)
    {
      return;
      int[] arrayOfInt1 = StaticInfo.mTotals;
      int n = this.mTotals;
      arrayOfInt1[4] = n;
      break;
      int[] arrayOfInt2 = StaticInfo.mTotals;
      int i1 = this.mTotals;
      arrayOfInt2[6] = i1;
      break;
      int[] arrayOfInt3 = StaticInfo.mTotals;
      int i2 = this.mTotals;
      arrayOfInt3[5] = i2;
      break;
      int i3 = StaticInfo.mTotals[5];
      this.mTotals = i3;
      MainTabActivity.mMode = 5;
      this.ly.mButton1.setSelected(1);
      this.ly.mButton2.setSelected(0);
      this.ly.mButton3.setSelected(0);
      break label84;
      MainTabActivity.mMode = 4;
      int i4 = StaticInfo.mTotals[4];
      this.mTotals = i4;
      this.ly.mButton1.setSelected(0);
      this.ly.mButton2.setSelected(1);
      this.ly.mButton3.setSelected(0);
      break label84;
      int i5 = StaticInfo.mTotals[6];
      this.mTotals = i5;
      MainTabActivity.mMode = 6;
      this.ly.mButton1.setSelected(0);
      this.ly.mButton2.setSelected(0);
      this.ly.mButton3.setSelected(1);
      break label84;
      label484: this.adapter.notifyDataSetChanged();
      this.mLvMessage.setVisibility(0);
      this.mLvMessage.setFocusable(1);
      this.mLvMessage.setFocusableInTouchMode(1);
    }
  }

  protected void loadCache()
  {
    int i = this.infoMode;
    loadCache(i);
  }

  public void loadCache(int paramInt)
  {
    switch (this.infoMode)
    {
    default:
    case 4:
    case 6:
    case 5:
    }
    while (true)
    {
      return;
      String str1 = this.mCacheDir;
      User localUser1 = StaticInfo.mUser;
      List localList1 = Utils.loadCommentMessageListFile(str1, localUser1);
      this.mList = localList1;
      continue;
      String str2 = this.mCacheDir;
      User localUser2 = StaticInfo.mUser;
      List localList2 = Utils.loadMessageListFile(str2, localUser2);
      this.mList = localList2;
      continue;
      String str3 = this.mCacheDir;
      User localUser3 = StaticInfo.mUser;
      List localList3 = Utils.loadAtListFile(str3, localUser3);
      this.mList = localList3;
    }
  }

  protected void loadMore(int paramInt)
  {
    reloadBegine(0);
    this.mExpectItem = paramInt;
    if ((this.mTask != null) && (!this.mTask.isCancelled()))
      boolean bool = this.mTask.cancel(1);
    ListBaseActivity.FetchDataTask localFetchDataTask1 = new ListBaseActivity.FetchDataTask(this);
    this.mTask = localFetchDataTask1;
    int i = this.mPage + 1;
    this.mPage = i;
    String str = String.valueOf(i);
    ListBaseActivity.FetchDataTask localFetchDataTask2 = this.mTask;
    String[] arrayOfString = new String[1];
    arrayOfString[0] = str;
    AsyncTask localAsyncTask = localFetchDataTask2.execute(arrayOfString);
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setTitleBar(0, null, null, null);
    ListView localListView = this.mlvBase;
    this.mLvMessage = localListView;
    int i = MainTabActivity.mMode;
    this.infoMode = i;
    int[] arrayOfInt = StaticInfo.mTotals;
    int j = MainTabActivity.mMode;
    int k = arrayOfInt[j];
    this.mTotals = k;
    int m = this.infoMode;
    setTitleBtnSelected(m);
  }

  public boolean onKeyDown(int paramInt, KeyEvent paramKeyEvent)
  {
    if (paramInt == 4)
    {
      AlertDialog.Builder localBuilder1 = new AlertDialog.Builder(this);
      AlertDialog.Builder localBuilder2 = localBuilder1.setTitle(2131427444).setIcon(2130837926).setCancelable(0);
      MessageGroup.2 local2 = new MessageGroup.2(this);
      AlertDialog.Builder localBuilder3 = localBuilder2.setPositiveButton(2131427441, local2);
      MessageGroup.3 local3 = new MessageGroup.3(this);
      AlertDialog.Builder localBuilder4 = localBuilder3.setNegativeButton(2131427436, local3);
      AlertDialog localAlertDialog = localBuilder1.show();
    }
    boolean bool;
    for (int i = 1; ; bool = super.onKeyDown(paramInt, paramKeyEvent))
      return i;
  }

  protected void onResume()
  {
    super.onResume();
    int i = getSharedPreferences("readmode", 0).getInt("readmode", 0);
    if (this.mReadMode != i)
    {
      this.mReadMode = i;
      this.adapter.notifyDataSetChanged();
    }
    boolean bool1;
    if ((StaticInfo.mUser == null) || (MainTabActivity.mSetSwitchTop))
      if (MainTabActivity.mSetSwitchTop)
        if (MainTabActivity.mSetSwitchTop)
        {
          bool1 = false;
          MainTabActivity.mSetSwitchTop = bool1;
          MainTabActivity localMainTabActivity = this.mParent;
          Intent localIntent = new Intent(this, SwitchUser.class);
          localMainTabActivity.startActivityForResult(localIntent, 0);
        }
    while (true)
    {
      return;
      bool1 = true;
      break;
      bool1 = MainTabActivity.mSetSwitchTop;
      break;
      if ((this.mTask != null) && (!this.mTask.isCancelled()))
        boolean bool2 = this.mTask.cancel(1);
      android.os.Message localMessage = new android.os.Message();
      localMessage.what = 0;
      boolean bool3 = this.handler.sendMessage(localMessage);
    }
  }

  protected void reloadList()
  {
    reloadBegine(1);
    this.mBeReload = 1;
    Intent localIntent1 = new Intent("sina.weibo.action.UPDATED");
    sendBroadcast(localIntent1);
    if ((this.mList != null) && (this.mList.size() != 0))
      switch (this.infoMode)
      {
      default:
      case 5:
      case 4:
      case 6:
      }
    while (true)
    {
      this.mPage = 1;
      this.mNewCount = 0;
      if (this.mTaskFree)
      {
        String str = String.valueOf(this.mPage);
        if ((this.mTask != null) && (!this.mTask.isCancelled()))
          boolean bool = this.mTask.cancel(1);
        ListBaseActivity.FetchDataTask localFetchDataTask1 = new ListBaseActivity.FetchDataTask(this);
        this.mTask = localFetchDataTask1;
        ListBaseActivity.FetchDataTask localFetchDataTask2 = this.mTask;
        String[] arrayOfString = new String[1];
        arrayOfString[0] = str;
        AsyncTask localAsyncTask = localFetchDataTask2.execute(arrayOfString);
      }
      this.mExpectItem = 1;
      return;
      Intent localIntent2 = localIntent1.putExtra("NOTIFY_KEY", 10003);
      sendBroadcast(localIntent1);
      long l1 = ((MBlog)this.mList.get(0)).time.getTime();
      this.lastestItemTime = l1;
      continue;
      Intent localIntent3 = localIntent1.putExtra("NOTIFY_KEY", 10001);
      sendBroadcast(localIntent1);
      long l2 = ((CommentMessage)this.mList.get(0)).commenttime.getTime();
      this.lastestItemTime = l2;
      continue;
      Intent localIntent4 = localIntent1.putExtra("NOTIFY_KEY", 10002);
      sendBroadcast(localIntent1);
      long l3 = ((com.sina.weibo.models.Message)this.mList.get(0)).time.getTime();
      this.lastestItemTime = l3;
      continue;
      this.lastestItemTime = 65535L;
    }
  }

  public void saveListCache(int paramInt, List<?> paramList)
  {
    switch (this.infoMode)
    {
    default:
    case 4:
    case 6:
    case 5:
    }
    while (true)
    {
      return;
      String str1 = this.mCacheDir;
      User localUser1 = StaticInfo.mUser;
      Utils.saveCommentMessageListFile(paramList, str1, localUser1);
      continue;
      String str2 = this.mCacheDir;
      User localUser2 = StaticInfo.mUser;
      Utils.saveMessageListFile(paramList, str2, localUser2);
      continue;
      String str3 = this.mCacheDir;
      User localUser3 = StaticInfo.mUser;
      Utils.saveAtListFile(paramList, str3, localUser3);
    }
  }

  protected void setContentView()
  {
    setView(2130903060);
  }

  class FetchSingleblogTask extends AsyncTask<String, Integer, MBlog>
  {
    String error;

    private FetchSingleblogTask()
    {
    }

    protected MBlog doInBackground(String[] paramArrayOfString)
    {
      MBlog localMBlog = null;
      String str1 = paramArrayOfString[0];
      Object[] arrayOfObject1 = (Object[])localMBlog;
      try
      {
        RPCHelper localRPCHelper = RPCHelper.getInstance(MessageGroup.this.getApplication());
        User localUser = StaticInfo.mUser;
        int i = MainTabActivity.mPrefPictureSize;
        Object[] arrayOfObject2 = localRPCHelper.getSingleMBlog(localUser, str1, i);
        localMBlog = (MBlog)arrayOfObject2[1];
        return localMBlog;
      }
      catch (RPCHelper.HttpException localHttpException)
      {
        while (true)
        {
          MessageGroup localMessageGroup = MessageGroup.this;
          Throwable localThrowable = Utils.getRootCause(localHttpException);
          String str2 = Utils.translationThrowable(localMessageGroup, localThrowable);
          this.error = str2;
        }
      }
    }

    protected void onCancelled()
    {
      MessageGroup.this.mTaskFree = 1;
    }

    protected void onPostExecute(MBlog paramMBlog)
    {
      MessageGroup.this.mTaskFree = 1;
      if (MessageGroup.this.mPgToast != null)
        MessageGroup.this.mPgToast.cancel();
      if (paramMBlog != null)
      {
        MessageGroup localMessageGroup = MessageGroup.this;
        Intent localIntent1 = new Intent(localMessageGroup, DetailWeiboActivity.class);
        Intent localIntent2 = localIntent1.putExtra("KEY_MBLOG", paramMBlog);
        User localUser = StaticInfo.mUser;
        Intent localIntent3 = localIntent1.putExtra("KEY_MUSR", localUser);
        MessageGroup.this.startActivity(localIntent1);
      }
    }

    protected void onPreExecute()
    {
      MessageGroup.this.mTaskFree = 0;
      MessageGroup.this.showProgress(1);
    }
  }

  class WeiboListAdapter extends BaseAdapter
  {
    public WeiboListAdapter()
    {
    }

    public int getCount()
    {
      int i = 0;
      int j;
      if (MessageGroup.this.mList == null)
      {
        j = 0;
        return j;
      }
      switch (MessageGroup.this.infoMode)
      {
      default:
      case 4:
      case 6:
      case 5:
      }
      while (true)
      {
        j = i;
        break;
        int k = MessageGroup.this.mPage;
        int m = StaticInfo.mTotals[4] / 25 + 1;
        if (k == m)
        {
          i = MessageGroup.this.mList.size() + 1;
          continue;
        }
        i = MessageGroup.this.mList.size() + 2;
        continue;
        int n = MessageGroup.this.mPage;
        int i1 = StaticInfo.mTotals[6] / 25 + 1;
        if (n == i1)
        {
          i = MessageGroup.this.mList.size() + 1;
          continue;
        }
        i = MessageGroup.this.mList.size() + 2;
        continue;
        int i2 = MessageGroup.this.mList.size();
        int i3 = StaticInfo.mTotals[5];
        if (i2 < i3)
        {
          i = MessageGroup.this.mList.size() + 2;
          continue;
        }
        i = MessageGroup.this.mList.size() + 1;
      }
    }

    public Object getItem(int paramInt)
    {
      return Integer.valueOf(paramInt);
    }

    public long getItemId(int paramInt)
    {
      return paramInt;
    }

    public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
    {
      MessageGroup.this.mUpdating = 1;
      paramInt += -1;
      int i = paramInt;
      int j = -1;
      Object localObject1;
      if (i == j)
      {
        localObject1 = MessageGroup.this.getReloadView();
        return localObject1;
      }
      int k = MessageGroup.this.mList.size();
      int m = paramInt;
      int n = k;
      Object localObject2;
      if (m == n)
      {
        localObject2 = MessageGroup.this.getLoadMoreView();
        switch (MessageGroup.this.infoMode)
        {
        default:
        case 4:
        case 6:
        case 5:
        }
        while (true)
        {
          localObject1 = localObject2;
          break;
          int i1 = MessageGroup.this.mPage;
          int i2 = StaticInfo.mTotals[4] / 25 + 1;
          if (i1 == i2)
          {
            ((View)localObject2).setVisibility(4);
            continue;
          }
          ((View)localObject2).setVisibility(0);
          continue;
          int i3 = MessageGroup.this.mPage;
          int i4 = StaticInfo.mTotals[6] / 25 + 1;
          if (i3 == i4)
          {
            ((View)localObject2).setVisibility(4);
            continue;
          }
          ((View)localObject2).setVisibility(0);
          continue;
          int i5 = MessageGroup.this.mList.size();
          int i6 = StaticInfo.mTotals[5];
          int i7 = i5;
          int i8 = i6;
          if (i7 < i8)
          {
            ((View)localObject2).setVisibility(0);
            continue;
          }
          ((View)localObject2).setVisibility(4);
        }
      }
      int i9 = 1;
      int i10 = 0;
      switch (MessageGroup.this.infoMode)
      {
      default:
        if (paramView != null)
          break;
        localObject2 = new com/sina/weibo/view/CommentMessageListItemView;
        MessageGroup localMessageGroup1 = MessageGroup.this;
        ListView localListView1 = MessageGroup.this.mLvMessage;
        List localList1 = MessageGroup.this.mList;
        int i11 = paramInt;
        CommentMessage localCommentMessage1 = (CommentMessage)localList1.get(i11);
        MessageGroup localMessageGroup2 = MessageGroup.this;
        int i12 = paramInt;
        boolean bool1 = localMessageGroup2.isNewCommer(i12);
        int i13 = MessageGroup.this.mReadMode;
        Object localObject3 = localObject2;
        int i14 = i10;
        localObject3.<init>(localMessageGroup1, localListView1, localCommentMessage1, 0, i14, bool1, i13);
      case 6:
      case 5:
      }
      while (true)
      {
        MessageGroup.this.mUpdating = 0;
        localObject1 = localObject2;
        break;
        if (paramView == null)
        {
          MessageGroup localMessageGroup3 = MessageGroup.this;
          ListView localListView2 = MessageGroup.this.mLvMessage;
          List localList2 = MessageGroup.this.mList;
          int i15 = paramInt;
          com.sina.weibo.models.Message localMessage1 = (com.sina.weibo.models.Message)localList2.get(i15);
          MessageGroup localMessageGroup4 = MessageGroup.this;
          int i16 = paramInt;
          boolean bool2 = localMessageGroup4.isNewCommer(i16);
          int i17 = MessageGroup.this.mReadMode;
          localObject2 = new MessageListItemView(localMessageGroup3, localListView2, localMessage1, 0, i10, bool2, i17);
          continue;
        }
        localObject2 = paramView;
        try
        {
          MainListItemView localMainListItemView1 = (MainListItemView)localObject2;
          List localList3 = MessageGroup.this.mList;
          int i18 = paramInt;
          Object localObject4 = localList3.get(i18);
          MessageGroup localMessageGroup5 = MessageGroup.this;
          int i19 = paramInt;
          boolean bool3 = localMessageGroup5.isNewCommer(i19);
          int i20 = MessageGroup.this.mReadMode;
          localMainListItemView1.update(localObject4, i9, i10, bool3, i20);
        }
        catch (Exception localException1)
        {
          MessageGroup localMessageGroup6 = MessageGroup.this;
          ListView localListView3 = MessageGroup.this.mLvMessage;
          List localList4 = MessageGroup.this.mList;
          int i21 = paramInt;
          com.sina.weibo.models.Message localMessage2 = (com.sina.weibo.models.Message)localList4.get(i21);
          MessageGroup localMessageGroup7 = MessageGroup.this;
          int i22 = paramInt;
          boolean bool4 = localMessageGroup7.isNewCommer(i22);
          int i23 = MessageGroup.this.mReadMode;
          localObject2 = new MessageListItemView(localMessageGroup6, localListView3, localMessage2, i9, i10, bool4, i23);
        }
        continue;
        if (paramView == null)
        {
          MessageGroup localMessageGroup8 = MessageGroup.this;
          ListView localListView4 = MessageGroup.this.mLvMessage;
          List localList5 = MessageGroup.this.mList;
          int i24 = paramInt;
          MBlog localMBlog1 = (MBlog)localList5.get(i24);
          MessageGroup localMessageGroup9 = MessageGroup.this;
          int i25 = paramInt;
          boolean bool5 = localMessageGroup9.isNewCommer(i25);
          int i26 = MessageGroup.this.mReadMode;
          localObject2 = new MBlogListItemView(localMessageGroup8, localListView4, localMBlog1, i9, i10, 0, bool5, i26);
          continue;
        }
        localObject2 = paramView;
        try
        {
          MainListItemView localMainListItemView2 = (MainListItemView)localObject2;
          List localList6 = MessageGroup.this.mList;
          int i27 = paramInt;
          Object localObject5 = localList6.get(i27);
          MessageGroup localMessageGroup10 = MessageGroup.this;
          int i28 = paramInt;
          boolean bool6 = localMessageGroup10.isNewCommer(i28);
          int i29 = MessageGroup.this.mReadMode;
          localMainListItemView2.update(localObject5, i9, i10, bool6, i29);
        }
        catch (Exception localException2)
        {
          MessageGroup localMessageGroup11 = MessageGroup.this;
          ListView localListView5 = MessageGroup.this.mLvMessage;
          List localList7 = MessageGroup.this.mList;
          int i30 = paramInt;
          MBlog localMBlog2 = (MBlog)localList7.get(i30);
          MessageGroup localMessageGroup12 = MessageGroup.this;
          int i31 = paramInt;
          boolean bool7 = localMessageGroup12.isNewCommer(i31);
          int i32 = MessageGroup.this.mReadMode;
          localObject2 = new MBlogListItemView(localMessageGroup11, localListView5, localMBlog2, i9, i10, 0, bool7, i32);
        }
        continue;
        localObject2 = paramView;
        try
        {
          MainListItemView localMainListItemView3 = (MainListItemView)localObject2;
          List localList8 = MessageGroup.this.mList;
          int i33 = paramInt;
          Object localObject6 = localList8.get(i33);
          MessageGroup localMessageGroup13 = MessageGroup.this;
          int i34 = paramInt;
          boolean bool8 = localMessageGroup13.isNewCommer(i34);
          int i35 = MessageGroup.this.mReadMode;
          localMainListItemView3.update(localObject6, i9, i10, bool8, i35);
        }
        catch (Exception localException3)
        {
          MessageGroup localMessageGroup14 = MessageGroup.this;
          ListView localListView6 = MessageGroup.this.mLvMessage;
          List localList9 = MessageGroup.this.mList;
          int i36 = paramInt;
          CommentMessage localCommentMessage2 = (CommentMessage)localList9.get(i36);
          MessageGroup localMessageGroup15 = MessageGroup.this;
          int i37 = paramInt;
          boolean bool9 = localMessageGroup15.isNewCommer(i37);
          int i38 = MessageGroup.this.mReadMode;
          localObject2 = new CommentMessageListItemView(localMessageGroup14, localListView6, localCommentMessage2, i9, i10, bool9, i38);
        }
      }
    }

    public int getViewTypeCount()
    {
      int i = 1;
      int j;
      if (MessageGroup.this.mList == null)
      {
        j = 1;
        return j;
      }
      switch (MessageGroup.this.infoMode)
      {
      default:
      case 4:
      case 6:
      case 5:
      }
      while (true)
      {
        j = i;
        break;
        int k = MessageGroup.this.mList.size();
        int m = StaticInfo.mTotals[4];
        if (k < m)
        {
          i = 4;
          continue;
        }
        i = 3;
        continue;
        int n = MessageGroup.this.mList.size();
        int i1 = StaticInfo.mTotals[6];
        if (n < i1)
        {
          i = 4;
          continue;
        }
        i = 3;
        continue;
        int i2 = MessageGroup.this.mList.size();
        int i3 = StaticInfo.mTotals[5];
        if (i2 < i3)
        {
          i = 4;
          continue;
        }
        i = 3;
      }
    }

    public void refresh()
    {
      notifyDataSetChanged();
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     com.sina.weibo.MessageGroup
 * JD-Core Version:    0.6.0
 */